package LinkDate;

import java.util.Scanner;

public class LinkTest {
    public static void main(String[] args) {
        LinkedNode linkedNode = new LinkedNode();
        while (true) {
            System.out.println("是否添加学生信息y or n");
            Scanner scanner = new Scanner(System.in);
            char ch = scanner.next().charAt(0);
            if (ch == 'n') {
                break;
            }
            System.out.println("输入学生的学号");
            int num1 = scanner.nextInt();
            System.out.println("输入学生的姓名");
            String name1 = scanner.next();
            //实例化节点 第二个
            Node node2 = new Node(num1, name1);
            linkedNode.add(node2);
        }
        linkedNode.show();
    }
}
